package com.jx.smartbot.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jx.smartbot.entityListener.WpAssistantListener;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the wp_assistant database table.
 * 
 */
@Entity
@Table(name="wp_assistant")
@NamedQuery(name="WpAssistant.findAll", query="SELECT w FROM WpAssistant w")
@EntityListeners(WpAssistantListener.class)
//@JsonIgnoreProperties(value={"transportOrders"})  
public class WpAssistant implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private long id;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="create_time")
	private Date createTime;

	private String description;

	private String function;

	private String icon;

	private String name;
	

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="update_time")
	private Date updateTime;

	@Column(name="user_id")
	private String userId;

	//bi-directional many-to-one association to WpAssistantAgent
	@OneToMany(mappedBy="wpAssistant",cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REMOVE})
	@JsonManagedReference
	private List<WpAssistantAgent> wpAssistantAgents;
	
	//bi-directional one-to-one association to WpAssistant
	@OneToOne(mappedBy="wpAssistant",cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REMOVE})
	@JsonManagedReference
	@JsonIgnore
	private WpAssistantGocom wpAssistantGocom;
	
	public WpAssistantGocom getWpAssistantGocom() {
		return wpAssistantGocom;
	}

	public void setWpAssistantGocom(WpAssistantGocom wpAssistantGocom) {
		this.wpAssistantGocom = wpAssistantGocom;
	}

	public WpAssistant() {
	}

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getFunction() {
		return this.function;
	}

	public void setFunction(String function) {
		this.function = function;
	}

	public String getIcon() {
		return this.icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public List<WpAssistantAgent> getWpAssistantAgents() {
		return this.wpAssistantAgents;
	}

	public void setWpAssistantAgents(List<WpAssistantAgent> wpAssistantAgents) {
		this.wpAssistantAgents = wpAssistantAgents;
	}

	public WpAssistantAgent addWpAssistantAgent(WpAssistantAgent wpAssistantAgent) {
		getWpAssistantAgents().add(wpAssistantAgent);
		wpAssistantAgent.setWpAssistant(this);

		return wpAssistantAgent;
	}

	public WpAssistantAgent removeWpAssistantAgent(WpAssistantAgent wpAssistantAgent) {
		getWpAssistantAgents().remove(wpAssistantAgent);
		wpAssistantAgent.setWpAssistant(null);

		return wpAssistantAgent;
	}



}